package com.huanrong.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.huanrong.dao.UserMapper;
import com.huanrong.model.User;
import com.huanrong.vo.JqGridPage;

@Service
public class UserService
{
    @Autowired
    private UserMapper userMapper;
    
    public List<User> list()
    {
        return userMapper.list();
    }
    
    public List<User> add()
    {
        User u = new User();
        u.setName(String.valueOf(System.currentTimeMillis()));
        userMapper.insertSelective(u);
        u = new User();
        u.setName(String.valueOf(System.currentTimeMillis()));
        userMapper.insertSelective(u);
        return userMapper.list();
    }
    
    public int listCount(JqGridPage jqGridPage)
    {
        return userMapper.listCount(jqGridPage);
    }
    
    public List<User> listByPage(JqGridPage jqGridPage)
    {
        return userMapper.listByPage(jqGridPage);
    }
}
